<style>
	.cntForm td
	{ldelim}
		padding: 5px;
	{rdelim}
</style>

{include file="stddecor.form.open.tpl" }
<table cellspacing="0" class="objHeader">
<tr>
    <td class="objHeader-td-icon"><img src="{$SPIcfg.dir.pubsite_styles|escape}manage/image/topic_icons/{$data.topic|escape}_{$data.tmode|escape}.gif" /></td>
    <td class="objHeader-td-header">
        <div>
            <h1>{$data.title|escape}</h1>
            <h2>{$data.subtitle|escape}</h2>
        </div>

        <div class="objHeader-action_buttons">
            <div class="right">{include file="obj.button.tpl" name="Назад" link=$data.link_back icon="back" }</div>
            <br class="clear" />
        </div>
    </td>
</tr>
</table>
{include file="stddecor.form.close.tpl" }

{* ************************************************************************* *}

{include file="stddecor.form.open.tpl" }

<form id="cntForm" name="cntForm" method="post" action="{$data.link_form_submit|escape}">
{foreach from=$data.formvars key=varname item=varvalue }
<input type="hidden" name="{$varname|escape}" value="{$varvalue|escape}" />
{/foreach}

<center>
<table cellspacing="0" cellpadding="0" class="cntForm">
<tr>
    <td class="cntForm-td-title"><div>Активность:</div></td>
    <td class="cntForm-td-object">
        <select class="select" name="field[workstatus]">
            <option value="1"{if '1' == $content.item_fields.workstatus } selected="selected"{/if}>Включено</option>
            <option value="0"{if '0' == $content.item_fields.workstatus } selected="selected"{/if}>Выключено</option>
        </select>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__workstatus"></td>
</tr>

{if $data.list_types|@count > 1 }
    <tr>
        <td class="cntForm-td-title"><div>Тип записи:</div></td>
        <td class="cntForm-td-object">
            <select class="select" name="field[type]">
            <option value="0">&lt;укажите значение&gt;</option>
            {foreach from=$data.list_types key=type_key item=type_name }
                <option value="{$type_key|escape}"{if $type_key == $content.item_fields.type } selected="selected"{/if}>{$type_name|escape}</option>
            {/foreach}
            </select>
        </td>
        <td class="cntForm-td-error buggy_obj buggy_obj__type"></td>
    </tr>
{elseif $data.const_type }
    <input type="hidden" name="field[type]" value="{$data.const_type|escape}" />
{/if}

{if $data.availTypes|@count > 0}
<tr>
    <td class="cntForm-td-title"><div>Тип параметра:</div></td>
    <td class="cntForm-td-object">
		<select name="field[type]" class="select">
			{foreach from=$data.availTypes key=typeId item=typeName}
				<option value="{$typeId|escape}" {if $typeId == $content.item_fields.type}selected{/if}/> {$typeName|escape}
			{/foreach}
		</select>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__type"></td>
</tr>
{/if}

<tr><td>&nbsp;</td></tr>

<tr>
    <td class="cntForm-td-title"><div>Найменование параметра:</div></td>
    <td class="cntForm-td-object">
        <input type="text" class="text" name="field[name]" value="{$content.item_fields.name|escape}" maxlength="128" />
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__name"></td>
</tr>

<tr>
    <td class="cntForm-td-title"><div>Единица измерения:</div></td>
    <td class="cntForm-td-object">
        <input type="text" class="text" name="field[point]" value="{$content.item_fields.point|escape}" maxlength="32" style="width:100px;" /> 
		<span class="light tiny">Например: грн - гривны, г - граммы, см - сантиметры, ...</span>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__point"></td>
</tr>

<tr>
    <td class="cntForm-td-title"><div>Элементы списка:</div></td>
    <td class="cntForm-td-object">
		<textarea cols="60" rows="4" class="textarea" name="field[values]">{$content.item_fields.values|escape}</textarea>
		<div class="light tiny">Только для элементов "{$data.availTypes.list}"</div>
		<div class="light tiny">Указывайте каждый новый элемент списка с новой строки</div>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__values"></td>
</tr>

<tr>
    <td class="cntForm-td-title"><div>Описание:</div></td>
    <td class="cntForm-td-object">
        <textarea cols="60" rows="4" class="textarea" name="field[description]">{$content.item_fields.description|escape}</textarea>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__description"></td>
</tr>

{if $content.item_fields.profile_addby_item }
<tr>
    <td class="cntForm-td-title"><div class="light">Создано:</div></td>
    <td class="cntForm-td-object"><div class="light">{$content.item_fields.profile_addby_item.fname|escape} {$content.item_fields.profile_addby_item.lname|escape} ({$content.item_fields.profile_addby_item.email|escape})</div></td>
    <td></td>
</tr>
{/if}

{if $content.item_fields.t_created }
<tr>
    <td class="cntForm-td-title"><div class="light">Дата создания:</div></td>
    <td class="cntForm-td-object"><div class="light">{$content.item_fields.t_created|date}</div></td>
    <td></td>
</tr>
{/if}

{if $content.item_fields.t_updated }
<tr>
    <td class="cntForm-td-title"><div class="light">Дата модификации:</div></td>
    <td class="cntForm-td-object"><div class="light">{$content.item_fields.t_updated|date}</div></td>
    <td></td>
</tr>
{/if}

</table>

<div class="splitter padded"></div>

<table cellspacing="8" cellpadding="0">
<tr>
    <td>{include file="obj.button.tpl" name="Сохранить" onclick="cntForm_submit()" icon="save" }</td>
    <td width="25">&nbsp;</td>
    <td>{include file="obj.button.tpl" name="Отменить" link=$data.link_back icon="cancel" }</td>
</tr>
</table>

</center>

</form>
{include file="stddecor.form.close.tpl" }

{* ************************************************************************* *}

{if $content.media_add }
    <br />
    {include file="media/manager.tpl" title="Дополнительные фотографии" item_title="Фото %s" media=$content.media_add }
{/if}

{* ************************************************************************* *}